import { HTTP } from '../utils/http'

class OrderService extends HTTP {
  getOrder(data) {
    return this.post({ url: '/user/:userId/order', data })
  }

  getOrders(data) {
    return this.get({ url: `/user/:userId/order`, data })
  }

  getOrderDetail(id) {
    return this.get({
      url: '/user/:userId/order/:orderId',
      data: { orderId: id },
    })
  }

  updateOrder(data) {
    return this.put({
      url: '/user/:userId/order/:orderId',
      data,
    })
  }
}

export { OrderService }
